﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MaLu.Common;
using System.Data;
using MaLu.BusiLogic;

namespace MaluJg.web.Poverty
{
    public partial class SLiveT : ProvertyPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();

            }

        }
        private void BindData()
        {
            DataSet ds = BLPoverty.SumLiving(Provider, Year, Village,HalfYear,"城镇");

            if (Village ==string.Empty)
            {

                divSingle.Visible = false;
                ltlHeader.Text = "马陆镇城镇低保汇总表";
                rpWhole.DataSource = ds;
                rpWhole.DataBind();

            }
            else
            {
                divWhole.Visible = false;


                ltlHeader.Text = "马陆镇"+Village+"城镇低保清单";



                rpSingle.DataSource = ds;
                rpSingle.DataBind();
            }
            Title = ltlHeader.Text;
            if (ds.Tables[1].Rows.Count > 0)
            {
                DataRow drsum = ds.Tables[1].Rows[0];
                sum7.Text = sum1.Text = drsum["sum1"].ToString();
                sum8.Text = sum2.Text = drsum["sum2"].ToString();
                sum9.Text = sum3.Text = drsum["sum3"].ToString();
                if (ds.Tables[1].Columns.Contains("sum4"))
                    sum10.Text = drsum["sum4"].ToString();
            }
        }
    }
}
